package com.zmkj.cn.sys.controller;

import com.zmkj.cn.sys.service.IWechatService;
import com.zmkj.cn.sys.vo.input.WxSendInputVo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 微信模版消息推送
 * @author 伍绍宇
 * @date 2021/04/29
 */
@RestController
@RequestMapping("/send")
public class WechatController {

    @Resource
    private IWechatService wechatService;

    /**
     * 发送转交模版
     * @author 伍绍宇
     * @date 2021/04/29
     */
    @PostMapping("/transfer")
    public Object transferTemplate(@ModelAttribute WxSendInputVo wxSendInputVo) {
        return wechatService.transferTemplate(wxSendInputVo);
    }

    /**
     * 发送派单模版
     * @author 伍绍宇
     * @date 2021/04/29
     */
    @PostMapping("/assign")
    public Object assignTemplate(@ModelAttribute WxSendInputVo wxSendInputVo) {
        return wechatService.assignTemplate(wxSendInputVo);
    }


    /**
     * 发送处理模版
     * @author 伍绍宇
     * @date 2021/04/29
     */
    @PostMapping("/make")
    public Object makeTemplate(@ModelAttribute WxSendInputVo wxSendInputVo) {
        return wechatService.makeTemplate(wxSendInputVo);
    }
    
    

    /**
     * 发送处理模版
     * @author 伍绍宇
     * @date 2021/04/29
     */
    @PostMapping("/createOrder")
    public Object createOrder(@ModelAttribute WxSendInputVo wxSendInputVo) {
        return wechatService.weChatTemplate(wxSendInputVo);
    }
    
    
    /**
     * 发送处理模版
     * @author 伍绍宇
     * @date 2021/04/29
     */
    @PostMapping("/assist")
    public Object assist(@ModelAttribute WxSendInputVo wxSendInputVo) {
        return wechatService.assistTemplate(wxSendInputVo);
    }

    /**
     * 项目、任务超时消息
     *
     */
    @PostMapping("/itemTimeOut")
    public Object itemTimeOut(@ModelAttribute WxSendInputVo wxSendInputVo) {
        return wechatService.itemTimeoutTemplate(wxSendInputVo);
    }

    /**
     * 排班值班消息
     *
     */
    @PostMapping("/schedule")
    public Object scheduleMsg(@ModelAttribute WxSendInputVo wxSendInputVo) {
        return wechatService.scheduleMsg(wxSendInputVo);
    }
    
    /**
         * 通用消息推送
     * @param wxSendInputVo
     * @return Object
     * @author sunshine
     * @date 2022年4月19日
     */
    @PostMapping("/commonSendMsg")
    public Object sendMsg(WxSendInputVo wxSendInputVo) {
    	return wechatService.commonSendMsg(wxSendInputVo);
    }
}
